#include<iostream>

using namespace std;

typedef long long LL;
LL a,b,c;
LL f[25][25][25];
LL function(LL a,LL b,LL c)
{
	if(a<=0||b<=0||c<=0) return 1;
	if(a>20||b>20||c>20) return function(20,20,20);
	if(f[a][b][c]) return f[a][b][c];

	if(a<b&&b<c) 
	{
		return f[a][b][c]=function(a,b,c-1)+
		function(a,b-1,c-1)-function(a,b-1,c);
	}
	else
	{
		return f[a][b][c]=function(a-1,b,c)+function(a-1,b-1,c)+
		function(a-1,b,c-1)-function(a-1,b-1,c-1);
	}
}
int main()
{
	while(cin>>a>>b>>c)
	{
		if(a==-1&&b==-1&&c==-1) break;
		printf("w(%lld, %lld, %lld) = %lld\n",a,b,c,function(a,b,c));
	}
}